package com.x.chalk.controller;

import com.x.chalk.config.SystemConfig;
import com.x.chalk.service.intf.MoodLikeService;
import com.x.chalk.service.intf.MoodService;
import com.x.chalk.vo.R;
import com.x.chalk.vo.parms.PageParams;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @author FSir
 * @create 2022-09-29 23:41
 */
@RestController
@RequestMapping("/api/mood/")
@Api("点赞相关操作")
@CrossOrigin//跨域
public class MoodLikeController {
    @Autowired
    private MoodLikeService moodLikeService;

    /**
     * 动态点赞
     * @param request
     * @return
     */
    @PostMapping("like.do")
    @ApiOperation(value = "动态点赞")
    public R like(Long mid, HttpServletRequest request){
       return  moodLikeService.like(request.getHeader(SystemConfig.HEADER_TOKEN),mid);
    }


}
